package features.advance.jdk.map;

import sun.reflect.generics.tree.Tree;

import java.util.*;

/**
 * @author LIN
 * @date 2021-04-29
 */
public class sorted {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();

        list.add("ab");
        list.add("aa");
        list.add("ba");
        list.add("bd");
        list.add("de");
        System.out.println(list);
        list.sort(Comparator.naturalOrder());
        System.out.println(list);

        TreeMap treeMap = new TreeMap<>();
        treeMap.put(-10,2);
        treeMap.put(-3,2);
        treeMap.put(0,2);
        treeMap.put(2,2);
        treeMap.put(9,2);
        Set set = treeMap.entrySet();
        Map.Entry entry = treeMap.firstEntry();
        System.out.println(entry);



    }
}
